import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const TabBar = () => import("@/components/tabBar/Index.vue");

const routes = [
  {
    path: "/",
    // component: () =>
    //   import(/* webpackChunkName: "index" */ "@/views/index/Index.vue"),
    components: {
      default: () =>
        import(/* webpackChunkName: "index" */ "@/views/index/Index.vue"),
      TabBar,
    },
  },

  {
    path: "/carts",
    components: {
      default: () =>
        import(/* webpackChunkName: "carts" */ "@/views/carts/Index.vue"),
      TabBar,
    },
  },
  {
    path: "/my",
    components: {
      default: () =>
        import(/* webpackChunkName: "carts" */ "@/views/my/Index.vue"),
      TabBar,
    },
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
